package com.open.capacity.dao;
import com.open.capacity.model.CommentModel;
import com.open.capacity.model.UserModel;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: y_022
 * @date: 18:24-2021/6/24
 * @description:
 */
public interface CommentDao {
    List<CommentModel> findCommentByUserId(@Param("userModel") UserModel userModel);

    void addComment(@Param("commentModel") CommentModel commentModel);

    void deleteComment(@Param("commentModel") CommentModel commentModel);


    @Select("select count(*) count from user_comment where userid =#{commentModel.userid} and orcode = #{commentModel.orcode}")
    int findComment(@Param("commentModel") CommentModel commentModel);
}
